package com.tally.framework.web.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Entity基类
 * @author soul
 */
@Getter
@Setter
public class BaseEntity implements Serializable
{

    @ApiParam(name = "搜索值", value = "searchValue")
    private String searchValue;

    /** 创建者 */
    @ApiParam(hidden = true)
    private String createBy;

    @ApiParam(name = "创建时间", value = "createTime")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createTime;

    /** 更新者 */
    @ApiParam(hidden = true)
    private String updateBy;

    @ApiParam(name = "更新时间", value = "updateTime")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long updateTime;

    @ApiParam(name = "备注", value = "remark")
    private String remark;

    @ApiParam(name = "请求参数", value = "params")
    private Map<String, Object> params;



    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<String, Object>();
        }
        return params;
    }

}
